<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="uiUser.xhtml">
	<ui:define name="head">
		<style type="text/css">
html {
	height: 100%;
}

body {
	height: 80%
}

.nestedUnit {
	border: 0px none !important;
}

.ui-layout-center .ui-layout-resizer {
	border: 1px solid #A8A8A8 !important;
}

.ui-tree-item span {
	float: left !important;
}

.ui-tree {
	border: 0px none !important;
}

.ui-tabs {
	border: 0px none !important;
}

.ui-confirm-dialog-severity {
	margin: 0 7px 7px 0;
}
</style>
	</ui:define>
	<ui:define name="content">
		<h:form id="frmMessage">
			<p:messages showDetail="false" sticky="true" />
		</h:form>
		<!-- Formulario para los menus -->
		<h:form id="frmMenu" prependId="false" method="get">
			<p:dataTable id="listTree" var="tree"
				value="#{TreeBean.mediumFolderModel}" rowKey="#{tree.id}"
				selection="#{TreeBean.selectedTrees}"
				emptyMessage="No se encontro ningun registro.">
				<f:facet name="header">
					<p:menubar autoDisplay="false">
						<p:menuitem rendered="#{TreeBean.profile.addDir}"
							title="Agregar directorio" icon="folderadd"
							onclick="dlgNew.show()" />
						<p:menuitem rendered="#{TreeBean.profile.editDir}"
							title="Renombrar directorio" icon="folderedit"
							actionListener="#{TreeBean.selectedRow}"
							oncomplete="editDialog.show()"
							update=":frmEditFolder:editDialog :frmMessage" />
						<p:menuitem rendered="#{TreeBean.profile.deleteDir}"
							title="Borrra directorio" icon="folderdelete"
							actionListener="#{TreeBean.selectedRow}"
							onclick="confirmation.show()" />
						<p:menuitem rendered="#{TreeBean.profile.fileLoad}"
							title="Cargar archivo" icon="pageadd"
							oncomplete="loadFileDialog.show()" update=":frmLoadFile" />
						<p:menuitem rendered="#{TreeBean.profile.renameFile}"
							title="Renombrar archivo" icon="pageedit"
							actionListener="#{TreeBean.selectedRow}"
							oncomplete="editFileDialog.show()"
							update=":frmEditFile:editFileDialog" />
						<p:menuitem rendered="#{TreeBean.profile.deleteFile}"
							title="Borrra archivo" url="#" icon="pagedelete" />
						<p:menuitem rendered="#{TreeBean.profile.findFile}"
							title="Buscar archivo" url="#" icon="pagefind" />
						<p:menuitem rendered="#{TreeBean.profile.copy}" title="Copiar"
							icon="copy" />
						<p:menuitem rendered="#{TreeBean.profile.paste}" title="Pegar"
							icon="paste" />
						<p:menuitem rendered="#{TreeBean.profile.addProperties}"
							title="Propiedades" icon="editproperties"
							actionListener="#{TreeBean.selectedRowProperties}"
							oncomplete="PropertiesDialog.show()"
							update=":frmProperties :frmMenu" />
						<p:menuitem rendered="#{TreeBean.profile.editProperties}"
							title="Cargar archivo de propiedades"
							update=":formPropertiesFile:display"
							oncomplete="fileDialog.show()" icon="addproperties" />
						<p:menuitem rendered="#{TreeBean.profile.sendEmail}"
							title="Enviar mail" oncomplete="composeDlg.show()"
							icon="sendmail" />
						<p:menuitem url="../login.faces" icon="exit" />
					</p:menubar>
				</f:facet>
				<p:column selectionMode="multiple" width="18" />
				<p:column sortBy="#{tree.type}">
					<f:facet name="header">
						<h:outputText value="Tipo" />
					</f:facet>
					<p:graphicImage alt="image" value="#{ImageBean.image}" width="30"
						height="30" cache="false">
						<f:param name="image_id" value="#{tree.id}" />
					</p:graphicImage>
				</p:column>
				<p:column id="modelHeader" sortBy="#{tree.name}">
					<f:facet name="header">
						<h:outputText value="Nombre" />
					</f:facet>
					<h:outputText value="#{tree.name}" />
				</p:column>
				<p:column sortBy="#{tree.size}">
					<f:facet name="header">
						<h:outputText value="Tamaño KB" />
					</f:facet>
					<h:outputText value="#{tree.size}" />
				</p:column>
				<p:column sortBy="#{tree.register}">
					<f:facet name="header">
						<h:outputText value="Fecha de creación" />
					</f:facet>
					<h:outputText value="#{tree.register}" />
				</p:column>
				<p:column sortBy="#{tree.user.name}">
					<f:facet name="header">
						<h:outputText value="Creado por:" />
					</f:facet>
					<h:outputText value="#{tree.user.name} #{tree.user.lastname}" />
				</p:column>
				<p:column style="width:12%; text-align: center;">
					<f:facet name="header">
						<h:outputText value="Propiedades" />
					</f:facet>
					<p:commandButton icon="checkin" oncomplete="downloadDialog.show()"
						update=":formDownloadFile" rendered="#{tree.type == 'Documento'}"
						title="Checkin"
						actionListener="#{TreeBean.prepareTreeDownload(tree.id)}" />
					<p:commandButton icon="checkout"
						rendered="#{tree.type == 'Documento'}" title="Checkout" />
				</p:column>
			</p:dataTable>
		</h:form>
	</ui:define>
</ui:composition>